home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 August: Tool Chest / Dev.CD Aug 00 TC Disk 2.toast / pc / sample code / quicktime / quicktime vr / vrscript.win / application files / comapplication.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-06-23  |  4.7 KB  |  166 lines

  1. //////////
  2. //
  3. //    File:        ComApplication.h
  4. //
  5. //    Contains:    Application-specific code for scripting application.
  6. //
  7. //    Written by:    Tim Monroe
  8. //
  9. //    Copyright:    © 1994-1997 by Apple Computer, Inc., all rights reserved.
  10. //
  11. //    Change History (most recent first):
  12. //
  13. //       <5>         09/24/97    rtm        upgraded to latest QuickTime VR headers
  14. //       <4>         09/11/97    rtm        merged MacApplication.h and WinApplication.h
  15. //       <3>         08/21/97    rtm        begun adding Windows support
  16. //       <2>         11/27/96    rtm        conversion to personal coding style
  17. //       <1>         12/21/94    khs        first file
  18. //       
  19. //////////
  20.  
  21. #pragma once
  22.  
  23. //////////
  24. // header files
  25. //////////
  26.  
  27. #ifndef __QUICKTIMEVR__
  28. #include <QuickTimeVR.h>
  29. #endif
  30.  
  31. #ifndef __QTUtilities__
  32. #include "QTUtilities.h"
  33. #endif
  34.  
  35. #ifndef __QTVRUtilities__
  36. #include "QTVRUtilities.h"
  37. #endif
  38.  
  39. #ifndef __URLUtilities__
  40. #include "URLUtilities.h"
  41. #endif
  42.  
  43. #include <MediaHandlers.h>
  44. #include <Movies.h>
  45. #include <Resources.h>
  46. #include <Sound.h>
  47. #include <SoundComponents.h>
  48. #include <SoundSprocket.h>
  49. #include <TextUtils.h>
  50.  
  51. #include <string.h>
  52. #include <stdlib.h>
  53.  
  54. #if TARGET_OS_MAC
  55. #include <AppleEvents.h>
  56. #include "MacFramework.h"
  57. #include "AppConfiguration.h"
  58. #endif
  59.  
  60. #if TARGET_OS_WIN32
  61. #include "WinFramework.h"
  62. #endif
  63.  
  64. #include "ComResource.h"
  65. #include "VRMovies.h"
  66. #include "VR3DObjects.h"
  67. #include "VRSound.h"
  68. #include "VREffects.h"
  69. #include "VRSprites.h"
  70. #include "VRHash.h"
  71.  
  72. //////////
  73. //
  74. // constants
  75. //
  76. //////////
  77.  
  78. #define kQTMaxSoundVolume        256
  79.  
  80. enum {
  81.     kScriptFileType                = FOUR_CHAR_CODE('TEXT'),
  82.     kScriptFileCreator            = FOUR_CHAR_CODE('VRsc')
  83. };
  84.  
  85. enum eAppMenus {
  86.     mTesting = 131
  87. };
  88.  
  89. enum eTestingMenu {
  90.     iTest1 = 1,
  91.     iTest2,
  92.     iTest3,
  93.     iTest4
  94. };
  95.  
  96. enum {
  97.     iTest1Item = MENU_IDENTIFIER(mTesting, iTest1),
  98.     iTest2Item,
  99.     iTest3Item,
  100.     iTest4Item
  101. };
  102.  
  103.  
  104. //////////
  105. //
  106. // structures
  107. //
  108. //////////
  109.  
  110. // application-specific data;
  111. // this data applies to a specific VR movie/window combination
  112. typedef struct ApplicationDataRecord {
  113.  
  114.     // *** QTVR callback procedures ***
  115.     QTVRBackBufferImagingUPP    fBackBufferProc;    // a routine descriptor for our back buffer routine
  116.     QTVRImagingCompleteUPP        fPrescreenProc;        // a routine descriptor for our prescreen routine
  117.     
  118.     // *** General data ***
  119.     Boolean                        fViewHasChanged;    // has the (pan, tilt, or FOV of the) view changed?
  120.     Boolean                        fSoundHasChanged;    // has some sound changed?
  121.     
  122.     // *** Embedded QuickTime movie data ***
  123.     MatrixRecord                fRotationMatrix;    // the rotation matrix for the embedded QuickTime movie
  124.     Boolean                        fDrewPrevBBProc;    // did we draw anything in the previous back buffer proc call?
  125.     
  126.     // *** SoundSprocket data ***
  127.     SSpListenerReference        fListener;            // the single listener
  128.     
  129.     // *** 3D object data ***
  130.     TQ3ViewObject                fView;                // the view for the scene
  131.     GWorldPtr                    fQD3DDCGWorld;        // the offscreen graphics world used for the pixmap draw context
  132.     Boolean                        fQD3DFOVIsVert;        // is the QD3D camera FOV vertical?
  133.     RGBColor                    fQD3DKeyColor;        // the color for chroma key compositing for QD3D textures (this is also the background color for the QD3D draw context)
  134.  
  135.     // *** QuickTime video effects data ***
  136.     GWorldPtr                    fSourceGWorld;        // the offscreen graphics world for the source node picture
  137.     GWorldPtr                    fTargetGWorld;        // the offscreen graphics world for the target node picture
  138.     ImageDescriptionHandle        fSourceGWDesc;        // the image description of the source offscreen graphics world
  139.     ImageDescriptionHandle        fTargetGWDesc;        // the image description of the target offscreen graphics world
  140.     VRScriptTransitionPtr        fActiveTransition;    // pointer to the list entry of the active node transition effect
  141.  
  142.     // *** Sprite data ***
  143.     Boolean                        fMovieHasSprites;    // does the movie have a sprite track?
  144.     MediaHandler                fSpriteHandler;        // the media handler for any sprite tracks
  145.     
  146.     // *** Array of our linked list head pointers ***
  147.     struct VRScriptGeneric        *fListArray[kVRScript_FinalEntryType + 1];
  148.     
  149. } ApplicationDataRecord, *ApplicationDataPtr, **ApplicationDataHdl;
  150.  
  151.  
  152. //////////
  153. //
  154. // function prototypes
  155. //
  156. //////////
  157.  
  158. #if TARGET_OS_MAC
  159. void                    InstallAppleEventHandlers (void);
  160. PASCAL_RTN OSErr        HandleOpenApplicationAppleEvent (const AppleEvent *theMessage, const AppleEvent *theReply, long theRefcon);            
  161. PASCAL_RTN OSErr        HandleOpenDocumentAppleEvent (const AppleEvent *theMessage, const AppleEvent *theReply, long theRefcon);
  162. PASCAL_RTN OSErr        HandlePrintDocumentAppleEvent (const AppleEvent *theMessage, const AppleEvent *theReply, long theRefcon);
  163. PASCAL_RTN OSErr        HandleQuitApplicationAppleEvent (const AppleEvent *theMessage, const AppleEvent *theReply, long theRefcon);
  164. #endif    // TARGET_OS_MAC
  165.  
  166. // the other function prototypes are in the file MacFramework.h or WinFramework.h